package com.zang.server.utils;

import com.zang.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 获取当前登录的用户
 *
 * @author 臧臧 on 2022/2/24
 */
public class UserUtils {
    public static Admin getAdmin(){
       return  (Admin)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}